package com.xiyun.admin.controller;

import com.xiyun.common.response.result.R;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@CrossOrigin
@RestController
@RequestMapping("/xiyun/service")
public class AdminController {

    @PostMapping("loginToken")
    @ResponseBody
    public R confirm(@RequestHeader Map<String,Object> head,
                          @RequestBody Map<String,Object> params){
        String username = params.get("username").toString();
        String password = params.get("password").toString();
        if ("admin".equals(username)&&"admin".equals(password)){
            return R.ok().data("token","token" + username + password);
        }
        return null;
    }
}
